package com.vr.xuecheng.media.controller;

import com.vr.xuecheng.media.service.IMediaProcessService;
import com.vr.xuecheng.media.util.Mp4VideoUtil;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author hzh
 */
@Slf4j
@RestController
@Tag(name = "媒体处理")
@RequestMapping("/mediaProcess")
@RequiredArgsConstructor
public class MediaProcessController {

    private final IMediaProcessService mediaProcessService;
    @Value("${videoprocess.ffmpeg-path}")
    private String ffmpeg_path;

    @GetMapping("/test")
    public String test() {
        Mp4VideoUtil mp4VideoUtil = new Mp4VideoUtil(ffmpeg_path, "D:\\Users\\hzh\\Desktop\\01.反馈和作业_ev.avi", "01.反馈和作业_ev.mp4", "D:\\Users\\hzh\\Desktop\\");
        String s = mp4VideoUtil.generateMp4();
        System.out.println(s);
        return "hello";
    }

}
